home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / getkey < prev    next >
Internet Message Format  |  1995-03-31  |  3KB

  1. From comp.sys.handhelds Fri Feb  8 13:01:27 1991
  2. Path: mentor.cc.purdue.edu!noose.ecn.purdue.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!hp-pcd!hpcvra.cv.hp.com!rnews!hpcvbbs!akcs.joehorn
  3. From: akcs.joehorn@hpcvbbs.UUCP (Joseph K. Horn)
  4. Newsgroups: comp.sys.handhelds
  5. Subject: HP 48SX GETKEY (fetch single key's defin
  6. Keywords: 48 getkey definition assignment
  7. Message-ID: <27b254e4:1993comp.sys.handhelds@hpcvbbs.UUCP>
  8. Date: 8 Feb 91 07:40:08 GMT
  9. Lines: 49
  10.  
  11. GETKEY, by Joseph K. Horn
  12.  
  13. Here's a useful utility for fetching a single key definition, very
  14. much like FETCH KEY on the HP 71.
  15.  
  16. The following RPL routine works instantly.  Shifted, alpha, and
  17. shifted alpha keys all work.  The only key it won't fetch is ATTN,
  18. which is used to exit the program if desired.
  19.  
  20. INSTRUCTIONS:  Run it, then press any key.  Its definition will be
  21. recalled to the stack, with its keycode above it.
  22.  
  23. It is most useful when assigned to a key; fetching a key definition
  24. only takes two keystrokes then.
  25.  
  26. RPL listing of GETKEY:
  27.  
  28. 02D9D Begin program object
  29. 2A2B4 0; for 0 WAIT construct
  30. 1A738 Internal WAIT; pause until key press; return rc.p keycode
  31. 03188 Internal DUP; float keycode until the end
  32. 41CA2 Convert rc.p keycode into <key> <plane> system keycodes
  33. 41F3F Recall contents of UserKeys var to the stack
  34. 03295 Internal ROT --> { UserKeys } <key>
  35. 056B6 Internal GET --> { all 6 definitions on that key } True
  36. 03244 Internal DROP; lose the True
  37. 63A6F Is the list empty? If so, push a True
  38. 6191F If True, DROP2, do next, and end; else skip next
  39. 6577B "Undefined"; the entire key is undefined; say so & stop
  40. 03223 Internal SWAP --> { the key's 6 definitions } <plane>
  41. 056B6 Internal GET --> either the definition or { }, and True
  42. 03244 Internal DROP; lose the True
  43. 63A6F Is the list empty? If so, push a True
  44. 618F7 If True, DROP, do next, and end; else skip next
  45. 6577B "Undefined"; that key is undefined; say so & stop
  46. 0312B End program; exit with keycode floating above definition.
  47.  
  48. ---- GETKEY in Wickes' ASC format -------------------------------
  49. %%HP:;
  50. "D9D204B2A2837A1881302AC14F3F14592306B65044230F6A36F1916B77563223
  51. 06B65044230F6A367F816B7756B2130D94E"
  52. -----------------------------------------------------------------
  53.  
  54. Before ASC-> conversion: Size 105,  CRC #144Ch.
  55. After ASC-> conversion:  Size 47.5, CRC #E49Dh.
  56.  
  57. Thanks to Rick Grevelle and Derek Nickel who made this possible.
  58.  
  59. -- Joseph K. Horn -- Peripheral Vision, Ltd. --
  60.  
  61.